From: Andy Holmes Date: Sun, 12 Feb 2023 21:54:07 +0000 (-0800) Subject: extensionDownloader: Compile gsettings schemas after install X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~14 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0a4cb82d9ae5aabe029c2204ae8b0322785cee40;p=gnome-shell.git extensionDownloader: Compile gsettings schemas after install After an extension is installed, run `glib-compile-schemas` on its `schemas` directory, if it exists. This should avoid any endianess-related issues for extensions when running GNOME Shell on varying architectures. Co-authored-by: Marco Trevisan (TreviƱo) Part-of: --- diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js index 94ba8fad5..b3cef41a6 100644 --- a/js/ui/extensionDownloader.js +++ b/js/ui/extensionDownloader.js @@ -113,6 +113,24 @@ async function extractExtensionArchive(bytes, dir) { ['unzip', '-uod', dir.get_path(), '--', file.get_path()], Gio.SubprocessFlags.NONE); await unzip.wait_check_async(null); + + const schemasPath = dir.get_child('schemas'); + const info = await schemasPath.query_info_async( + Gio.FILE_ATTRIBUTE_STANDARD_TYPE, + Gio.FileQueryInfoFlags.NONE, + GLib.PRIORITY_DEFAULT, + null); + + if (info.get_file_type() === Gio.FileType.DIRECTORY) { + const compileSchema = Gio.Subprocess.new( + ['glib-compile-schemas', '--strict', schemasPath.get_path()], + Gio.SubprocessFlags.NONE); + try { + await compileSchema.wait_check_async(null); + } catch (e) { + log(`Error while compiling schema for extension ${dir.get_basename()}: (${e.message})`); + } + } } /**